import service from '@/utils/request';

export const getDataDirectoryList = (pageIndex = 1, pageSize = 10) => {
    return service({
        url: '/data/getDataDirectoryList',
        method: 'get',
        params: {
            pageIndex,
            pageSize,
        },
    });
};

export const addDataDirectory = (data) => {
    return service({
        url: '/data/addDataDirectory',
        method: 'POST',
        data: {
            directoryName: data.directoryName,
            parentId: data.parentId
        }
    });
};

export const updateDataDirectory = (data) => {
    return service({
        url: '/data/updateDataDirectory',
        method: 'PUT',
        data: {
            directoryId: data.directoryId,
            directoryName: data.directoryName,
            parentId: data.parentId
        }
    });
};

export const deleteDataDirectory = (data) => {
    return service({
        url: '/data/deleteDataDirectory',
        method: 'DELETE',
        data: {
            directoryId: data.directoryId
        }
    });
};
